<template>
    <div>
       <p>{{this.$route.params.id}}</p>
       {{msg}}
      <ul v-for="(item,index) in songlist" :key="index">
         <router-link :to="'/newsong/'+item.id"> {{index+1}}=={{item.name}}</router-link>
      </ul>
    </div>
</template>
<script>
import axios from 'axios'
// import detail from '../common/Detail'
export default {
    name:'resonglistde',
    data(){
        return{
             msg:'safdf',
            //  id:'',
             songlist:[]
        }
    },methods:{
        nsj(){
            this.msg=this.$route.params.id
        }
        ,getsong(){
            axios({
                method:'get',
                url:'http://localhost:5000/playlist/detail?id='+this.$route.params.id
            }).then((res)=>{
                console.log(res);
                this.songlist=res.data.playlist.tracks;
                // this.id=this.$route.params.id;
            }).catch((err)=>{
                console.log(err)
            })
        }
    
    },mounted(){
        this.getsong();
    }
}
</script>